﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="empprofile.aspx.cs" Inherits="Hired.empprofile"
    MasterPageFile="Hired2Div.master" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<asp:Content ID="ContentHead" runat="server" ContentPlaceHolderID="HeadPlaceHolder">
    <style type="text/css">
        .profile_left
        {
            float: left;
            width: 180px;
        }
        .profile_right
        {
            float: left;
            width: 540px;
        }
        .profile_listedjobs
        {
            float: left;
            width: 270px;
            height: 575px;
            background: url(images/listedjobs.png);
        }
        
        .profile_viewlistedjobs
        {
            float: right;
            margin-right: 3px;
            margin-top: 140px;
        }
        p.profile
        {
            margin-top: 10px;
            padding-right: 0px;
            padding-left: 0px;
        }
        p.listedjobs
        {
            margin-top: 48px;
        }
        .profile_addjob
        {
            float: right;
            overflow: hidden;
            width: 97px;
            height: 26px;
            margin-right: 3px;
            margin-top: 7px;
            background: url(images/addJob.png);
        }
        
        .heading
        {
            position: relative;
            padding-left: 5px;
            font-family: Impact;
            font-size: 120%;
            color: Silver;
            top: 0px;
            left: 0px;
        }
        
        .headingline
        {
            width: 335px;
            bottom: 0px;
        }
        
        .txtComment
        {
            overflow: hidden;
        }
        
        .style4
        {
            color: #C0C0C0;
            font-size: medium;
        }
        
        .updateinfo
        {
            float: right;
        }
        
        .buddyrequest
        {
            float: right;
        }
    </style>
</asp:Content>
<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="LeftPlaceHolder">
    <asp:UpdatePanel ID="updatePanel" runat="server">
        <ContentTemplate>
            <div class="profile_left">
                <br />
                <asp:Image ID="imgProfile" runat="server" ImageUrl="~/Images/ProfilePic.png" />
                <br />
                <br />
                <p class="profile">
                    <asp:ImageButton ID="btnWall" runat="server" ImageUrl="images/Wall.png" OnClick="btnWall_Click" /></p>
                <p class="profile">
                    <asp:ImageButton ID="btnInformation" runat="server" ImageUrl="images/empinfo.png"
                        OnClick="btnInformation_Click" /></p>
                <p class="profile">
                    <asp:ImageButton ID="btnBuddyList" runat="server" ImageUrl="images/buddyList.png"
                        OnClick="btnBuddyList_Click" /></p>
                <p class="profile">
                    <asp:ImageButton ID="btnInbox" runat="server" ImageUrl="images/inbox.png" OnClick="btnInbox_Click" /></p>
                <p class="profile">
                    <asp:ImageButton ID="btnImages" runat="server" ImageUrl="images/images.png" OnClick="btnImages_Click" />
                </p>
            </div>
            <div class="profile_right">
                <asp:Panel ID="pnlWall" runat="server">
                    <asp:Label ID="lblUsername" runat="server" Font-Bold="True" Font-Size="Large"></asp:Label>
                    <br />
                    <asp:TextBox ID="txtComment" runat="server" Height="40px" TextMode="MultiLine" Width="450px"
                        CssClass="txtComment"></asp:TextBox>
                    <asp:Button ID="btnComment" runat="server" Text="Comment" Width="79px" OnClick="btnComment_Click" />
                   <asp:Panel ID="pnlContainer" runat="server">
                </asp:Panel> <%--  <asp:TextBoxWatermarkExtender ID="txtComment_TextBoxWatermarkExtender" 
                runat="server" Enabled="True" TargetControlID="txtComment" 
                WatermarkCssClass="watermark" WatermarkText="Click here to write a comment...">
            </asp:TextBoxWatermarkExtender>--%>
                </asp:Panel>
                
                <asp:Panel ID="pnlPersonalInformation" runat="server" Visible="false" Style="position: relative;">
                    <div class="heading">
                        Company information<div class="headingline">
                        </div>
                    </div>
                    <div class="updateinfo">
                        <asp:LinkButton ID="lblUpdateInfo" runat="server" Font-Size="X-Small" OnClick="lblUpdateInfo_Click">Update your information...</asp:LinkButton>
                    </div>
                    <br />
                    <p>
                        <asp:Label ID="lblCompanyName" runat="server">Company Name:</asp:Label>
                        &nbsp;<asp:Label ID="lblCompanyNameValue" runat="server"></asp:Label>
                    </p>
                    <p>
                        <asp:Label ID="lblDateFounded" runat="server">Date Founded:</asp:Label>
                        &nbsp;<asp:Label ID="lblDateFoundedValue" runat="server"></asp:Label>
                    </p>
                    <p>
                        <asp:Label ID="lblContactNumber" runat="server">Contact Number:</asp:Label>
                        &nbsp;<asp:Label ID="lblContactNumberValue" runat="server"></asp:Label>
                    </p>
                    <p>
                        <asp:Label ID="lblWebsite" runat="server">Website:</asp:Label>
                        &nbsp;<asp:Label ID="lblWebsiteValue" runat="server"></asp:Label>
                    </p>
                    <p>
                        <asp:Label ID="lblEmailAddress" runat="server">E-mail address:</asp:Label>
                        &nbsp;<asp:Label ID="lblEmailAddressValue" runat="server"></asp:Label>
                    </p>
                    <p>
                        <asp:Label ID="lblAddress" runat="server">Address:</asp:Label>
                        &nbsp;<asp:Label ID="lblAddressValue" runat="server"></asp:Label>
                    </p>
                    <p>
                        <asp:Label ID="lblPostalCode" runat="server">ZIP/Postal Code:</asp:Label>
                        &nbsp;<asp:Label ID="lblPostalCodeValue" runat="server"></asp:Label>
                    </p>
                    <asp:Panel ID="pnlEmployerInformation" runat="server" Visible="false">
                        <div class="heading">
                            Employer information<div class="headingline">
                            </div>
                        </div>
                        <br />
                        <p>
                            <asp:Label ID="lblFirstName" runat="server">First Name:</asp:Label>
                            &nbsp;<asp:Label ID="lblFirstNameValue" runat="server"></asp:Label>
                        </p>
                        <p>
                            <asp:Label ID="lblLastName" runat="server">Last Name:</asp:Label>
                            &nbsp;<asp:Label ID="lblLastNameValue" runat="server"></asp:Label>
                        </p>
                    </asp:Panel>
                </asp:Panel>
                <asp:Panel ID="pnlUpdateInformation" runat="server" Visible="false">
                    <div class="heading">
                        Company information<div class="headingline">
                        </div>
                    </div>
                    <br />
                    <p>
                        Company Name:
                        <asp:TextBox ID="txtCompanyName" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldCoName" runat="server" ErrorMessage="Required Field"
                            ForeColor="Red" Display="Dynamic" Font-Size="X-Small" ControlToValidate="txtCompanyName"
                            ValidationGroup="RegisterGroup"></asp:RequiredFieldValidator>
                    </p>
                    <p>
                        Date Founded:
                        <asp:TextBox ID="txtDateFounded" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldDFounded" runat="server" ErrorMessage="Required Field"
                            ForeColor="Red" Display="Dynamic" Font-Size="X-Small" ControlToValidate="txtdateFounded"
                            ValidationGroup="RegisterGroup"></asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator ID="RegularExpressionDateFounded" runat="server"
                            ControlToValidate="txtDateFounded" Display="Dynamic" ErrorMessage="Date founded must be dd-mm-yyyy"
                            Font-Size="X-Small" ForeColor="Red" ValidationExpression="^(0[1-9]|[12][0-9]|3[01])[-](0[1-9]|1[012])[-](19|20)\d\d$"
                            ValidationGroup="RegisterGroup"></asp:RegularExpressionValidator>
                        <asp:CustomValidator ID="CustomDateFounded" runat="server" ControlToValidate="txtDateFounded"
                            Display="Dynamic" ErrorMessage="Date founded cannot be after today" Font-Size="X-Small"
                            ForeColor="Red"></asp:CustomValidator>
                    </p>
                    <p>
                        Contact Number:
                        <asp:TextBox ID="txtContactNum" runat="server"></asp:TextBox>
                        <asp:RegularExpressionValidator ID="RegularExpressionHP" runat="server" ControlToValidate="txtContactNum"
                            ErrorMessage="Please enter only number" Font-Size="X-Small" ForeColor="Red" ValidationExpression="^[+]?\d+$"
                            ValidationGroup="RegisterGroup"></asp:RegularExpressionValidator>
                    </p>
                    <p>
                        Website:
                        <asp:TextBox ID="txtWebsiteUrl" runat="server"></asp:TextBox>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtWebsiteUrl"
                            ErrorMessage="Invalid Website" Font-Size="X-Small" ForeColor="Red" ValidationExpression="http(s)?://([\w-]+\.)+[\w-]+(/[\w- ./?%&amp;=]*)?"></asp:RegularExpressionValidator>
                    </p>
                    <p>
                        <asp:Label ID="lblEmail" runat="server">E-mail address:</asp:Label>
                        &nbsp;<asp:Label ID="lblEmailValue" runat="server"></asp:Label>
                    </p>
                    <p>
                        Address:
                        <asp:TextBox ID="txtAddress1" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldAddress" runat="server" Display="Dynamic"
                            ErrorMessage="Required Field" Font-Size="X-Small" ForeColor="Red" ControlToValidate="txtAddress1"
                            ValidationGroup="RegisterGroup"></asp:RequiredFieldValidator>
                    </p>
                    <p>
                        ZIP/Postal code:
                        <asp:TextBox ID="txtPostalCode" runat="server" Width="128px" Height="22px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldPostalCode" runat="server" ErrorMessage="Required Field"
                            ForeColor="Red" Display="Dynamic" Font-Size="X-Small" ControlToValidate="txtPostalCode"
                            ValidationGroup="RegisterGroup"></asp:RequiredFieldValidator>
                    </p>
                    <asp:Panel ID="pnlEmployerInfo" runat="server" Visible="false">
                        <div class="heading">
                            <span class="style4">Employer</span> <span class="style4">information</span><div
                                class="headingline">
                            </div>
                        </div>
                        <br />
                        <p>
                            First Name:
                            <asp:TextBox ID="txtFirstName" runat="server" Width="128px"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtFirstName"
                                ErrorMessage="Required Field" Font-Size="X-Small" ForeColor="Red"></asp:RequiredFieldValidator>
                        </p>
                        <p>
                            Last Name:
                            <asp:TextBox ID="txtLastName" runat="server" Width="128px"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="Required Field"
                                Font-Size="X-Small" ForeColor="Red"></asp:RequiredFieldValidator>
                        </p>
                    </asp:Panel>
                    <asp:Button ID="btnUpdate" runat="server" Text="Update information" Style="float: right;
                        margin-right: 5px;" ValidationGroup="UpdateGroup" OnClick="btnUpdate_Click" />
                </asp:Panel>
                <br />
                <asp:Panel ID="pnlBuddyList" runat="server" Visible="false" Style="width: 560px;">
                    <div class="heading">
                        Your Buddy List<div class="headingline">
                        </div>
                        <div class="buddyrequest">
                            <asp:LinkButton ID="lblBuddyRequest" runat="server" Font-Size="X-Small" OnClick="lblBuddyRequest_Click">View buddy requests</asp:LinkButton>
                        </div>
                    </div>
                    <asp:ListView ID="lvBuddyList" runat="server" DataKeyNames="Username">
                            <EmptyDataTemplate>
                                <span>No data was returned.</span>
                            </EmptyDataTemplate>
                            <ItemTemplate>
                                <table width="560px">
                                    <tr>
                                        <td width="100px">
                                            <asp:Image ID="imgBuddyProfile" runat="server" ImageUrl='<%# Eval("ImageAddress") %>' />
                                        </td>
                                        <td>
                                            <asp:LinkButton ID="lblBuddyName" runat="server" Text='<%# Eval("Name") %>' PostBackUrl='<%# "viewprofile.aspx?username=" + Eval("Username") %>' />
                                        </td>
                                    </tr>
                                </table>
                            </ItemTemplate>
                            <LayoutTemplate>
                                <div id="itemPlaceholderContainer" runat="server" style="font-family: Verdana, Arial, Helvetica, sans-serif;">
                                    <span runat="server" id="itemPlaceholder" />
                                </div>
                                <div style="text-align: center; background-color: #FFCC66; font-family: Verdana, Arial, Helvetica, sans-serif;
                                    color: #333333;">
                                    <asp:DataPager ID="DataPager1" runat="server">
                                        <Fields>
                                            <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" ShowLastPageButton="True" />
                                        </Fields>
                                    </asp:DataPager>
                                </div>
                            </LayoutTemplate>
                        </asp:ListView>
                </asp:Panel>
                <asp:Panel ID="pnlBuddyRequests" runat="server" Visible="false">
                    <div class="heading">
                        Your buddy requests<div class="headingline">
                        </div>
                    </div>
                    <p>&nbsp;</p>
                    <asp:GridView ID="gvBuddyRequests" runat="server" AutoGenerateColumns="False" 
                        onrowcommand="gvBuddyRequests_RowCommand">
                        <Columns>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:Image ID="imgProfilePic" runat="server" />
                                    <asp:LinkButton ID="linkBtnUsername" runat="server" Text=<%# Eval("Username") %> PostBackUrl=<%# "viewprofile.aspx?username=" + Eval("UserID")%>></asp:LinkButton>
                                    <br />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:Button ID="btnAccept" runat="server" Text="Accept" CommandName="Accept" CommandArgument=<%# Eval("UserID") %> />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:Button ID="btnDecline" runat="server" Text="Decline" CommandName="Decline" CommandArgument=<%# Eval("UserID") %>/>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                </asp:Panel>
                <asp:Panel ID="pnlInbox" runat="server" Visible="false">
                    <div class="heading">
                        Your inbox<div class="headingline">
                        </div>
                    </div>
                    <p>
                        <asp:GridView ID="gvInbox" runat="server" AutoGenerateColumns="False" CssClass="gvQuestions"
                            DataKeyNames="MessageID" OnRowCommand="gvInbox_RowCommand">
                            <Columns>
                                <asp:TemplateField HeaderText="From" SortExpression="MessageID">
                                    <ItemTemplate>
                                        <asp:LinkButton ID="lblUsername" runat="server" Text='<%# Eval("Username") %>' PostBackUrl='<%# "viewprofile.aspx?username=" + Eval("Username") %>' />
                                        
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Title" SortExpression="Title">
                                    <ItemTemplate>
                                        <asp:LinkButton ID="lblTitle" runat="server" Text='<%# Eval("Title") %>' CommandName="Select"
                                            CommandArgument='<%# Eval("MessageID") %>' />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="Timestamp" HeaderText="Time sent" SortExpression="Timestamp" />
                                <asp:TemplateField HeaderText="Delete" ShowHeader="False">
                                    <ItemTemplate>
                                        <asp:ImageButton ID="btnDelete" runat="server" CausesValidation="False" ImageUrl="images/deleteicon.png"
                                            CommandName="Delete" CommandArgument='<%# Eval("MessageID") %>' />
                                        <asp:Panel ID="pnlDeletePopup" runat="server" CssClass="modalPopup">
                                            Confirm delete?
                                            <br />
                                            <br />
                                            <asp:Button ID="btnCancel" Style="float: right" runat="server" Text="Cancel" />
                                            <asp:Button ID="btnConfirm" Style="float: right; margin-right: 25px;" runat="server"
                                                Text="OK" />
                                            <br />
                                        </asp:Panel>
                                        <asp:ConfirmButtonExtender ID="btnDelete_ConfirmButtonExtender" runat="server" ConfirmText=""
                                            Enabled="True" TargetControlID="btnDelete" DisplayModalPopupID="DeleteModalPopupExtender">
                                        </asp:ConfirmButtonExtender>
                                        <asp:ModalPopupExtender ID="DeleteModalPopupExtender" runat="server" TargetControlID="btnDelete"
                                            DropShadow="True" PopupControlID="pnlDeletePopUp" CancelControlID="btnCancel"
                                            OkControlID="btnConfirm" BackgroundCssClass="modalBackground">
                                        </asp:ModalPopupExtender>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <HeaderStyle BackColor="#9933FF" ForeColor="White" HorizontalAlign="Center" />
                            <RowStyle BorderStyle="Outset" HorizontalAlign="Left" VerticalAlign="Middle" />
                        </asp:GridView>
                    </p>
                    <p>
                        &nbsp;<asp:Panel ID="pnlMessage" runat="server" Visible="false">
                            <table width="560px">
                                <tr>
                                    <td class="style1">
                                        From:
                                    </td>
                                    <td>
                                        <asp:Label ID="lblMessageSender" runat="server" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="style1">
                                        Title:
                                    </td>
                                    <td>
                                        <asp:Label ID="lblMessageTitle" runat="server" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="style1">
                                        Contents:
                                    </td>
                                    <td>
                                        <asp:Label ID="lblMessageContents" runat="server" />
                                    </td>
                                </tr>
                            </table>
                        </asp:Panel>
                </asp:Panel>
                <asp:Panel ID="pnlImages" runat="server" Visible="False" Style="width: 560px;">
                    <div class="heading">
                        Your images<div class="headingline">
                        </div>
                    </div>
                    <div class="lvImages">
                        <asp:ListView ID="lvImages" runat="server" DataKeyNames="ImageAddress" DataSourceID="edsEmp">
                            <ItemTemplate>
                                <asp:Image ID="imgThumbnail" runat="server" Width="120px" Height="120px" ImageUrl='<%# Eval("ImageAddress") %>'
                                    CssClass="imgThumbnail" />
                                <asp:ModalPopupExtender ID="lvImageModalPopupExtender" runat="server" TargetControlID="imgThumbnail"
                                    DropShadow="False" CancelControlID="btnExit" PopupControlID="pnlImgPopup" BackgroundCssClass="modalBackground" />
                                <asp:Panel ID="pnlImgPopup" runat="server" CssClass="modalPopup">
                                    <asp:Image ID="imgPopup" runat="server" ImageUrl='<%# Eval("ImageAddress") %>' />
                                    <br />
                                    <br />
                                    <asp:ImageButton ID="btnExit" runat="server" Text="Exit" ImageUrl="images/closelabel.gif"
                                        Style="float: right;" />
                                    <br />
                                </asp:Panel>
                            </ItemTemplate>
                            <LayoutTemplate>
                                <table>
                                    <tr>
                                        <td runat="server" id="itemPlaceHolder">
                                        </td>
                                    </tr>
                                </table>
                                <asp:DataPager ID="DataPagerImages" runat="server" PagedControlID="lvImages" PageSize="1"
                                    style="float: right; margin: 15px 5px 5px auto;">
                                    <Fields>
                                        <asp:NextPreviousPagerField NextPageText="" />
                                        <asp:NumericPagerField NextPageText="" PreviousPageText="" />
                                        <asp:NextPreviousPagerField NextPageText="Next..." PreviousPageText="" />
                                    </Fields>
                                </asp:DataPager>
                            </LayoutTemplate>
                        </asp:ListView>
                    </div>
                    <asp:EntityDataSource ID="edsEmp" runat="server" ConnectionString="name=hireddbEntities"
                        DefaultContainerName="hireddbEntities" EnableFlattening="False" EntitySetName="ImageRosters"
                        Where="it.UserID == @ID">
                        <WhereParameters>
                            <asp:ControlParameter ControlID="lvImages" DbType="String" DefaultValue="" Name="id"
                                PropertyName="SelectedValue" />
                        </WhereParameters>
                    </asp:EntityDataSource>
                </asp:Panel>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content2" runat="server" ContentPlaceHolderID="RightPlaceHolder">
    <div class="profile_listedjobs">
        <div class="profile_addjob">
            <a href="createjob.aspx" class="hidden-text">Add a New job </a>
        </div>
        <p class="listedjobs">
            &nbsp;</p>
        <p class="listedjobs">
            &nbsp;</p>
        <p class="listedjobs">
            &nbsp;</p>
        <div class="profile_viewlistedjobs">
            <asp:LinkButton ID="linkBtnViewAll" runat="server" OnClick="linkBtnViewAll_Click">View All</asp:LinkButton>
        </div>
    </div>
</asp:Content>
